<?
session_start();
include('conn.php');
// $custid = $_SESSION['custid'];
// $bid = $_SESSION['bid'];
// $fromdt=$_SESSION['fromdt'];
// $todt=$_SESSION['todt'];
// $subid=$_SESSION['subid'];

// $date=$_SESSION['todt'];
// $day= substr($date,0,2);
// $month = substr($date,3,2);
// $year = substr($date,6,4);
// $todt=$year.'-'.$month.'-'.$day;

// $date=$_SESSION['fromdt'];
// $day= substr($date,0,2);
// $month = substr($date,3,2);
// $year = substr($date,6,4);
// $fromdt=$year.'-'.$month.'-'.$day;

$qry1 = "SELECT tranid, `Bkng Date` BkngDate , `ID Number` IDNumber, `Pax Name` PaxName, `Ticket Number` TicketNumber, transactiondetails.PNR PNR, Sector, `Travel Date` TravelDate , Basic, Tax, Admincharges, Amount
FROM transactiondetails join transactionmast on transactiondetails.tranid = transactionmast.trnid where status = 0";

$qry = mysql_query($qry1);

$data = array();
while($rows = mysql_fetch_array($qry))
{
	$data[] = array("Referenceno" => $rows['tranid'],
				  "BkngDate" => $rows['BkngDate'],
				  "IDNumber" => $rows['IDNumber'],
				  "PaxName" => $rows['PaxName'],
				  "PNR" => $rows['PNR'],
				  "Sector" => $rows['Sector'],
				  "TravelDate" => $rows['TravelDate'],
				  "Basic" => $rows['Basic'],
				  "Tax" => $rows['Tax'],
				  "Admincharges" => $rows['Admincharges'],
				  "Amount" => $rows['Amount']);
}
echo json_encode($data);

?>